//
//  HomeViewController.m
//  WeiKa
//
//  Created by 黄博 on 2017/7/31.
//  Copyright © 2017年 我的合伙人科技. All rights reserved.
//

#import "HomeViewController.h"
#import "LeftView.h"
#import "RightView.h"
#import "Masonry.h"
#import "UIView+Test.h"

@interface HomeViewController ()

@property(nonatomic, strong) LeftView *leftView;
@property(nonatomic, strong) RightView *rightView;
@property(nonatomic, strong) UIView *lineView;

@end

@implementation HomeViewController

- (void)viewWillAppear:(BOOL)animated {
    
    [self.navigationController setNavigationBarHidden:YES animated:NO];
    
    [super viewWillAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:NO];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
    [self setUpView];
}

- (void)setUpView {
    [self.view addSubview:self.leftView];
    [self.view addSubview:self.rightView];
    
    [self.leftView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.bottom.equalTo(self.view);
        make.right.equalTo(self.rightView.mas_left);
    }];
    
    [self.rightView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.right.bottom.equalTo(self.view);
        make.width.equalTo(self.view.mas_width).multipliedBy(0.35);
    }];
    
    [self.view addSubview:self.lineView];
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.equalTo(self.view);
        make.left.equalTo(self.leftView.mas_right);
        make.width.equalTo(@(0.5f));
    }];
}

#pragma mark - getter
- (LeftView *)leftView {
    if (!_leftView) {
        _leftView = [LeftView viewFromXIB];
    }
    return _leftView;
}

- (RightView *)rightView {
    if (!_rightView) {
        _rightView = [RightView viewFromXIB];
    }
    return _rightView;
}

- (UIView *)lineView {
    if (!_lineView) {
        _lineView = [UIView new];
    }
    return _lineView;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}


@end
